/************************************************************
 * Copyright (C), 2022-2030, ripnano. Co., Ltd.
 * FileName:        form_tool_bar.h
 * Author:          Dan Yin
 * Date:            2024-03-01
 * Description:     the class of tool bar
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_TOOL_BAR_H
#define FORM_TOOL_BAR_H

// add necessary includes here
#include "ui/defines/global.h"

namespace Ui {
class FormToolBar;
}

class FormToolBar : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormToolBar" class, if exist, return it
    static FormToolBar* getInstance(QWidget *pParent = nullptr);

    // The default destructor
    virtual ~FormToolBar();

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

signals:
    // Show test page
    void signalShowPageHome();

    // Show setting page
    void signalShowPageSetting();

    // Show result page
    void signalShowPageResult();

    // Show factory page
    void signalShowPageFactory();

private slots:
    void on_pushButton_Home_clicked(bool checked);

    void on_pushButton_Setting_clicked(bool checked);

    void on_pushButton_Factory_clicked(bool checked);

    void slotSetToolbarDisabled(bool bTesting);

    void slotSetToolbarChecked(int nPageIdx);

private:
    // The default constructor
    FormToolBar(QWidget *parent = nullptr);

    // After constructing object, initialize the object
    void _initialze();

    // Init the window style
    void _initUi();

    // Clicked a function button
    void _buttonChecked(int nIdx);

private:
    Ui::FormToolBar *ui;
};

#endif // FORM_TOOL_BAR_H
